home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / LinkSpec.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  3.2 KB  |  158 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: LinkSpec.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODLinkSpec_xh
  18. #define SOM_ODLinkSpec_xh
  19.  
  20. class ODLinkSpec;
  21.  
  22. #define ODLinkSpec_MajorVersion 1
  23. #define ODLinkSpec_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODBaseLinkSpec_xh
  31. #include <LinkSpcB.xh>
  32. #endif
  33.  
  34. #ifndef ODLinkSpec_API
  35. #define ODLinkSpec_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODBaseLinkSpec;
  50. class ODStorageUnit;
  51. class ODLinkSpec;
  52. class ODDraft;
  53. class ODPart;
  54.  
  55. /*
  56.  * End of user-defined types.
  57.  */
  58.  
  59. #ifdef OLDIBMSOMAPISUPPORT
  60. #define ODLinkSpecCClassData ODLinkSpecClassData
  61. #define ODLinkSpecNewClass(major,minor) somNewVersionedClassReference(ODLinkSpec,major,minor)
  62. #endif
  63.  
  64. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  65. #define ODLinkSpecMetaClass SOMClass
  66.  
  67. #if PRAGMA_ALIGN_SUPPORTED
  68. #  pragma options align=power
  69. #endif
  70.  
  71. /* The API to the ODLinkSpec class object, and the methods it introduces. */
  72. SOMEXTERN struct ODLinkSpecClassDataStructure {
  73. #ifdef OLDIBMSOMAPISUPPORT
  74.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  75. #else
  76.     long zero;
  77. #endif
  78.     somStaticClassInfo *sci;
  79.     somDToken        instanceDataToken;
  80.     long reserved [3];
  81.     somMToken reserved1;
  82.     somMToken reserved2;
  83.     somMToken reserved3;
  84.     somMToken reserved4;
  85. } SOMDLINK ODLinkSpecClassData;
  86.  
  87. #if PRAGMA_ALIGN_SUPPORTED
  88. #  pragma options align=reset
  89. #endif
  90.  
  91. #if !defined(ODLinkSpec_Class_Source) && !defined(SOM_Module_linkspec_Source)
  92. #if PRAGMA_IMPORT_SUPPORTED
  93. #pragma import list ODLinkSpecClassData
  94. #endif
  95. #endif
  96.  
  97.  
  98. /*
  99.  * -- Typedefs and inline method declarations for left path inherited methods
  100.  * -- are omitted because this compilation had -museinheritedmethods in effect
  101.  */
  102.  
  103.  
  104. /*
  105.  * -- Typedefs for ODLinkSpec Method Procedures
  106.  */
  107. SOMEXTERN {
  108. }
  109.  
  110. #endif /* ODLinkSpec_API */
  111.  
  112.  
  113. /*
  114.  * -- This emitter treats Method Tokens as Thunks by default.
  115.  * -- Use the sc modifier "nothunks" to change this default
  116.  */
  117. #undef somresolve_
  118. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  119.  
  120. /*
  121.  * -- The C++ Wrapper Class for ODLinkSpec
  122.  */
  123. class ODLinkSpec : public ODBaseLinkSpec
  124. {
  125. public:
  126.  
  127. // ODLinkSpec::new registers use of the class object, and then uses somNew
  128. // to allocate memory and load the object method table pointer. 
  129. void *operator new(size_t size)
  130. {
  131.     SOM_IgnoreWarning(size);
  132.     // Allocate memory using the default allocator for ODLinkSpec, and
  133.     // clear mem & set method table pointer, call basic initialization
  134. #ifdef SOMCHKNULL
  135.     void * __somResult = (void *)
  136.       somNewObject(ODLinkSpec);
  137.     SOMCHKNULL(__somResult);
  138.     return __somResult;
  139. #else
  140.     return (void*) somNewObject(ODLinkSpec);
  141. #endif
  142. }
  143.  
  144. // ODLinkSpec::delete uses the default deallocator for the object's class.
  145. void operator delete(void * obj)
  146. {
  147.     if (obj) {
  148.         SOM_Resolve(obj,SOMObject,somFree)
  149.            ( (SOMObject*) obj );
  150.     }
  151. }
  152.  
  153. };   /* ODLinkSpec */
  154.  
  155.  
  156.  
  157. #endif       /* SOM_ODLinkSpec_xh */
  158.